home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / asm / alib11b.zip / CODE1.ZIP / CMOS / CMOSREAD.ASM < prev    next >
Assembly Source File  |  1994-10-03  |  638b  |  36 lines

  1. ;----------------------------------------------------------------------------
  2. ; read_cmos - read cmos data
  3. ;  inputs:  al = address
  4. ;  outputs: al = cmos data read
  5. ;
  6. read_cmos:
  7.     pushf
  8.     rol    al,1
  9.     stc
  10.     rcr    al,1
  11.     cli
  12.     out    70h,al            ;output address
  13.     nop
  14.     nop
  15.     nop
  16.     in    al,71h            ;read data port
  17.     push    ax
  18.     mov    al,1ah            ;get default address
  19.     rcr    al,1            ;add in nmi bit
  20.     out    70h,al            ;select default loc
  21. ;
  22. ; dummy read for reported problem with PS/2 computers
  23. ;
  24.     in    al,71h            ;read cmos
  25.     
  26.     sti
  27.     pop    ax            ;restore data read
  28.     push    cs
  29.     call    popf_sub
  30.     ret
  31. ;
  32. ; this code restores flags, and nmi state
  33. ;
  34. popf_sub:
  35.     iret
  36.